<?php
require "../lib.dir.php";
class data{

public $message;
public $projects;
}



if(isset($_GET['do'])){

  if($_GET['do']=='create_project')
  {
	  if(isset($_POST['project_name'])){


		//mkdir("projects/".$_POST['project_name']);
		$_POST['project_name']=str_replace(".","_",$_POST['project_name']);
			$_POST['project_name']=str_replace("/","_",$_POST['project_name']);
				$_POST['project_name']=str_replace("\\","_",$_POST['project_name']);
		if($_POST['project_name']==""){
		  
        $x=new data();
		$x->message="invalid dir name";
		echo json_encode($x);
		
		
		}
		else{
		recurse_copy("../default_radt","../projects/".$_POST['project_name']);
		//chown()
        $x=new data();
		$x->message="done";
		$x->projects=get_projects("../");
		echo json_encode($x);
		}

	}
  
  }
	else if($_GET['do']=='get_pack_files'){
	
			
	
	
	}
   


}
else{


}

?>
